package org.thread.test05.demo04;

/**
 * @author ZJL
 * @date 2025-03-12
 */
public class Printer {
    private String print;

    public String getPrint() {
        return print;
    }

    public void setPrint(String print) {
        this.print = print;
    }

    public synchronized void print(String user,String msg) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println(user+":"+msg);
    }
}
